package com.crape.common.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.crape.common.constants.ErrorCode;
import com.crape.common.constants.MessageCode;

public class ApplictionRuntimeListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("###Appliction Init...");
        System.out.println("###"+System.getProperty("java.library.path"));
        ServletContext context = sce.getServletContext();
        context.setAttribute("messageCodeMap", MessageCode.codeMap);
        context.setAttribute("errorCodeMap", ErrorCode.codeMap);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("###Appliction Destroved");
    }

}
